import request from '@/utils/request'

export function getAllDetail(module) {
  const condition = {}
  condition['module'] = module
  condition['mem'] = true
  condition['cpu'] = true
  condition['uptime'] = true
  condition['disk'] = true
  condition['network'] = true
  condition['nic'] = true
  condition['process'] = true
  condition['os'] = true
  condition['limit'] = true
  condition['swap'] = true

  return request({
    url: 'rtc/zwmpDetail',
    method: 'post',
    data: condition
  })
}

export function getCPUDetail(module) {
  const condition = {}
  condition['module'] = module
  condition['mem'] = false
  condition['cpu'] = true
  condition['uptime'] = false
  condition['disk'] = false
  condition['network'] = false
  condition['nic'] = false
  condition['process'] = false
  condition['os'] = false
  condition['limit'] = false
  condition['swap'] = false

  return request({
    url: 'rtc/zwmpDetail',
    method: 'post',
    data: condition
  })
}

export function getOSDetail(module) {
  const condition = {}
  condition['module'] = module
  condition['mem'] = false
  condition['cpu'] = false
  condition['uptime'] = false
  condition['disk'] = false
  condition['network'] = false
  condition['nic'] = false
  condition['process'] = false
  condition['os'] = true
  condition['limit'] = true
  condition['swap'] = false

  return request({
    url: 'rtc/zwmpDetail',
    method: 'post',
    data: condition
  })
}

export function getDiskDetail(module) {
  const condition = {}
  condition['module'] = module
  condition['mem'] = false
  condition['cpu'] = false
  condition['uptime'] = false
  condition['disk'] = true
  condition['network'] = false
  condition['nic'] = false
  condition['process'] = false
  condition['os'] = false
  condition['limit'] = false
  condition['swap'] = false

  return request({
    url: 'rtc/zwmpDetail',
    method: 'post',
    data: condition
  })
}

export function getMemDetail(module) {
  const condition = {}
  condition['module'] = module
  condition['mem'] = true
  condition['cpu'] = false
  condition['uptime'] = false
  condition['disk'] = false
  condition['network'] = false
  condition['nic'] = false
  condition['process'] = false
  condition['os'] = false
  condition['limit'] = false
  condition['swap'] = true

  return request({
    url: 'rtc/zwmpDetail',
    method: 'post',
    data: condition
  })
}

export function getNetworkDetail(module) {
  const condition = {}
  condition['module'] = module
  condition['mem'] = false
  condition['cpu'] = false
  condition['uptime'] = false
  condition['disk'] = false
  condition['network'] = true
  condition['nic'] = true
  condition['process'] = false
  condition['os'] = false
  condition['limit'] = false
  condition['swap'] = false

  return request({
    url: 'rtc/zwmpDetail',
    method: 'post',
    data: condition
  })
}
